/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module TRT.c - Transaction Requirement Table Header File |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/trt.h $ 
**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef TRT_H
#define TRT_H

#define MAX_FIELDS              60 /* ***IF THIS FIELD VALUE CHANGES THEN THE SIZE OF 
                                      MSG_TRT_FIELDFUNCPTR IN TRTFLD.TXT MUST CHANGE
                                      TO TWICE THE VALUE */
                                      
typedef struct TagTRT
{
	short TransactionCode;                 /* Field 1      */
	short TranType;                        /* Field 2      */
	short CardMode;                        /* Field 3      */
    char TranAbbrev[TRT_ABBREV_SIZE + 1];  /* Field 4      */
    short BannedCardTypes;        		   /* Field 5      */
    short TipProc;                         /* Field 6: 0-Off, 1-On,Prompt, 2-On,No Prompt */ 
	

	unsigned short  DataCapture		        	: 1;    /* Field 7      */
	unsigned short Overage                  		: 1;    /* Field 8      */
	unsigned short Reversal			        	: 1;    /* Field 9      */
	unsigned short CheckFloorLimit	        	: 1;    /* Field 10     */
	unsigned short NotUsed1			        	: 1;    /* Field 11     */
	unsigned short Allowed			        	: 1;    /* Field 12     */
	unsigned short AdjustAllowed		    		: 1;    /* Field 13     */
	unsigned short VoidAllowed		        	: 1;    /* Field 14     */
	unsigned short PrintReceipt		        	: 1;    /* Field 15     */
	unsigned short AdjustReceipt		    		: 1;    /* Field 16     */
	unsigned short VoidReceipt		        	: 1;    /* Field 17     */
	unsigned short Offline			        	: 1;    /* Field 18     */
	unsigned short AdjustOffline		    		: 1;    /* Field 19     */
	unsigned short VoidOffline		        	: 1;    /* Field 20     */
	unsigned short IncInvNum			    		: 1;    /* Field 21     */  
	unsigned short AdjustIncInvNum	        	: 1;    /* Field 22     */

	unsigned short    Loaded       : 1;    /* padded bits */
	unsigned short    f7                : 1;    /* padded bits */
	unsigned short    f6                : 1;    /* padded bits */
	unsigned short    f5                : 1;    /* padded bits */
	unsigned short    f4                : 1;    /* padded bits */
	unsigned short    f3                : 1;    /* padded bits */
	unsigned short    f2                : 1;    /* padded bits */
	unsigned short    f1                : 1;    /* padded bits */
	unsigned short VoidIncInvNum		    		: 1;    /* Field 23     */
	unsigned short IncHostInvNum		    		: 1;    /* Field 24     */
	unsigned short AdjustIncHostInvNum	       	: 1;    /* Field 25     */
	unsigned short VoidIncHostInvNum	    		: 1;    /* Field 26     */
	unsigned short RetryPrompt         			: 1;    /* Field 27     */
	unsigned short NotUsed4    					: 1;    /* Field 28     */
	unsigned short NotUsed3						: 1;    /* Field 29     */
	unsigned short NotUsed2				    	: 1;    /* Field 30     */

	short   shFieldFuncPtr[MAX_FIELDS];           /* Field 31     */
} TRT_REC;

#ifdef __arm
#define SIZE_TRT_REC  (sizeof(TRT_REC) + (sizeof (TRT_REC) % 4))
#endif
#ifdef _TARG_68000
#define SIZE_TRT_REC  sizeof(TRT_REC)
#endif

#endif // TRT_H

#ifndef INTRAN_H

#include <transact.h>

	int inLoadTRTRec (TRANSACTION_OBJECT *pobTran, int inTranCode);
	int inSaveTRTRec (TRANSACTION_OBJECT *pobTran, int inTranCode);

	short	shGetTransactionCode(TRANSACTION_OBJECT *pobTran);
	void 	vdSetTransactionCode(TRANSACTION_OBJECT *pobTran, short param);
	short	shGetTranType(TRANSACTION_OBJECT *pobTran);
	void 	vdSetTranType(TRANSACTION_OBJECT *pobTran, short param);
	short	shGetCardMode(TRANSACTION_OBJECT *pobTran);
	void 	vdSetCardMode(TRANSACTION_OBJECT *pobTran, short param);
	short	shGetTipProc(TRANSACTION_OBJECT *pobTran);
	void 	vdSetTipProc(TRANSACTION_OBJECT *pobTran, short param);
	char*	szGetTranAbbrev(TRANSACTION_OBJECT *pobTran);
	void 	vdSetTranAbbrev(TRANSACTION_OBJECT *pobTran, char* param);
	short 	shGetBannedCardTypes(TRANSACTION_OBJECT *pobTran);
	void 	vdSetBannedCardTypes(TRANSACTION_OBJECT *pobTran, short param);
	VS_BOOL	fGetAdjustIncInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAdjustIncInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetIncInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetIncInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetVoidOffline(TRANSACTION_OBJECT *pobTran);
	void 	vdSetVoidOffline(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetAdjustOffline(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAdjustOffline(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetVoidReceipt(TRANSACTION_OBJECT *pobTran);
	void 	vdSetVoidReceipt(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetAdjustReceipt(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAdjustReceipt(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetVoidAllowed(TRANSACTION_OBJECT *pobTran);
	void 	vdSetVoidAllowed(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetAdjustAllowed(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAdjustAllowed(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetAllowed(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAllowed(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetDataCapture(TRANSACTION_OBJECT *pobTran);
	void 	vdSetDataCapture(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetVoidIncHostInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetVoidIncHostInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetAdjustIncHostInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetAdjustIncHostInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetIncHostInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetIncHostInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetVoidIncInvNum(TRANSACTION_OBJECT *pobTran);
	void 	vdSetVoidIncInvNum(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	
	VS_BOOL	fGetOverage(TRANSACTION_OBJECT *pobTran);
	void 	vdSetOverage(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetCheckFloorLimit(TRANSACTION_OBJECT *pobTran);
	void 	vdSetCheckFloorLimit(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetReversal(TRANSACTION_OBJECT *pobTran);
	void 	vdSetReversal(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetPrintReceipt(TRANSACTION_OBJECT *pobTran);
	void 	vdSetPrintReceipt(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetOffline(TRANSACTION_OBJECT *pobTran);
	void 	vdSetOffline(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	
	VS_BOOL	fGetNotUsed1(TRANSACTION_OBJECT *pobTran);
	void 	vdSetNotUsed1(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetNotUsed2(TRANSACTION_OBJECT *pobTran);
	void 	vdSetNotUsed2(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetNotUsed3(TRANSACTION_OBJECT *pobTran);
	void 	vdSetNotUsed3(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetNotUsed4(TRANSACTION_OBJECT *pobTran);
	void 	vdSetNotUsed4(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	VS_BOOL	fGetRetryPrompt(TRANSACTION_OBJECT *pobTran);
	void 	vdSetRetryPrompt(TRANSACTION_OBJECT *pobTran, VS_BOOL param);
	
#endif // INTRAN_H

